﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HIWSystem.Attributes;

namespace HIWSystem.Models
{
    /// <summary>
    /// 增加自定义特性目的是为了批量导入验证
    /// </summary>
    public class ProductionPlanEntity
    {
        /// <summary>
        ///工单
        /// </summary>
        [Required("工单是必填项")]
        [RegularExpression("工单必须以WO开头","^WO")]
        public string WO { get; set; }
        /// <summary>
        /// 机种
        /// </summary>
        [Required("机种是必填项")]
        public string PN { get; set; }
        /// <summary>
        /// 工序
        /// </summary>
        [Required("生产工序是必填项")]
        public string Station { get; set; }
        /// <summary>
        /// 计划产量
        /// </summary>
        [Required("计划产量是必填项")]
        [RegularExpression("计划产量必须是有效数字",@"^[1-9]\d*$")]
        public int PlanOutput { get; set; }
        /// <summary>
        /// 星期
        /// </summary>
        [Required("星期是必填项")]
        [Range("星期的有效范围是【1-7】",7,1)]
        public string WeekDay { get; set; }
        /// <summary>
        /// 周别
        /// </summary>
        [Required("周别是必填项")]
        [Range("周别的有效范围是【1-54】",54,1)]
        public string Week { get; set; }
        /// <summary>
        /// 年份
        /// </summary>
        [Required("年份是必填项")]
        [Range("年份的有效范围是【1900-2100】",2100,1900)]
        public string Year { get; set; }
        /// <summary>
        /// 班别
        /// </summary>
        [Required("班别是必填项")]
        public string Shift { get; set; }
        /// <summary>
        /// 工号
        /// </summary>
        [Required("录入人是必填项")]
        public string Actor { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public string CreateAt { get; set; }
    }
}
